﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Configuration;

/// <summary>
/// Summary description for Userlogin
/// </summary>
namespace Bestlife.ERP.DataAccess
{
    public class D_Admin_Userlogin
    {
        SqlDataReader rdRr;

        public  Boolean userlog(string User_Name, string Password)
        {
            Boolean name = false;
            SqlConnection conn_new = new SqlConnection();
            try
            {
                String connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString;
                Bestlife.ERP.DataAccess.clsCon.connect(connStr);

                String Ssql = "SELECT [Use_Type] FROM [Tbl_Admin_User] where Use_Name='" + User_Name + "' and Pas_Word='" + Password + "' ";
                //SqlDataReader ldr = Bestlife.ERP.DataAccess.clsCon.ReadTable(Ssql);

             
                rdRr = clsCon.ReadTable(Ssql);

                if (rdRr.Read())
                {
                    name = true;

                }
                else
                {
                    name = false;
                }
            }
            catch (Exception)
            {

            }
            finally 
            {
                rdRr.Close();
                conn_new.Close();
            }
            return name;
        }

        
    }

}